import threading
import time


class TestSingle():
    one = None

    def __init__(self):
        time.sleep(2)
        # pass

    @classmethod
    def oneSingle(cls):
        if cls.one:
            print("存在")
            return cls.one
        else:
            print("不存在,创建")
            cls.one = TestSingle()
            return cls.one


def task():
    t = TestSingle.oneSingle()
    print(t)


for i in range(10):
    t = threading.Thread(target=task)
    t.start()
